﻿#if UNITY_EDITOR
using UnityEngine;

namespace JProfiler
{ 
    public static class UIColor
    {
        static internal Color Color256(int r, int g, int b, int a)
        {
            return new Color((float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, (float)a / 255.0f);
        }

        public static readonly Color white = new UnityEngine.Color(1.0f, 1.0f, 1.0f);
    }
    public static class LayoutSize
    {
        public static readonly int WidthRHS = 400;
        public static readonly int FilterOptionsRightEnumWidth = 150;

        public static readonly int MinWindowWidth = 800 + WidthRHS;
        public static readonly int MinWindowHeight = 480;

        public static readonly int WindowWidth = MinWindowWidth;
        public static readonly int WindowHeight = 840;
        public static readonly int ScrollBarPadding = 6;
    }

    public static class Styles
    {

        public static readonly GUIContent running = new GUIContent("Start", "Start Profiler");
        public static readonly GUIContent clear = new GUIContent("Clear", "Clear profiler data");
        public static readonly GUIContent export = new GUIContent("Export", "Export profiler data");

        public static readonly GUIContent summary = new GUIContent("Summary", "");
        public static readonly GUIContent profileTitle = new GUIContent("JProfiler Detail Information", "");

        public static readonly string helpText = @"
1   目前C#的是<事件的处理>次数 注意不是发送事件的次数
    Lua的是<Update函数调用>次数 如果有同一个脚本的多个类会叠加计算
2   开销记录单位是1/10000毫秒 即10000个单位代表1ms
    *由于精度问题仅供参考
    *可能会出现嵌套的情况
3   C#内存对应的是<Mono内存>变化 => Profiler.GetMonoUsedSizeLong()
    Lua内存对应的是<Lua虚拟机内存>变化 => collectgarbage('count')
    内存变化单位均为<字节>
";
    }

    public enum MyColumns
    {
        Name,
        Type,
        TotalCount,
        CountPerSec,
        CountPerMin,
        TotalCost,
        CostAve,
        CostMin,
        CostMax,
        TotalMem,
        MemAve,
        MemMin,
        MemMax,
    }

    public enum SortOption
    {
        Name,
        Type,
        TotalCount,
        CountPerSec,
        CountPerMin,
        TotalCost,
        CostAve,
        CostMin,
        CostMax,
        TotalMem,
        MemAve,
        MemMin,
        MemMax,
    }
}
#endif